import { HTTP } from '../util/http.js'

class LikeModel extends HTTP {

  constructor() {
    super()
  }

  like(behavior, artID, category) {
    console.log('like', behavior, artID, category)
    let url = behavior == 'like' ? 'like' : 'like/cancel'
    console.log('url', url)
    this.request({
      url: url,
      method: 'POST',
      data: {
        art_id: artID,
        type: category
      },
    })
  }


  getClassicLikeStatus(artID, category, sCallback) {
    this.request({
      url: 'classic/' + category + '/' + artID + '/favor',
      success: (res) => {
        sCallback(res)
      }
    })
  }
}

export { LikeModel }